#include <stdio.h>
#include <stdint.h>
#include <pthread.h>
#include <string.h>
#include <uart.h>
#include <stdint.h>
#include <unistd.h>
#include "mydef.h"
#include "main.h"


#ifndef __MYTHREAD_H__
#define __MYTHREAD_H__
#define MSGBUFFSIZE 5120
typedef struct __MSG
{
    uint8_t buff[MSGBUFFSIZE];
    int16_t len;
    int16_t fd;    
}MSG;

extern MSG ttyS0_copy;
extern pthread_t ttyS0RxThread;
extern pthread_t ttyS0RxThreadID;
extern pthread_t ttyS0TxThread;
extern pthread_t ttyS0TxThreadID;
extern pthread_t ttyS0KeyThreadID; //按键测试线程
extern pthread_t ttyS1RxThread; 
extern pthread_t ttyS1RxThreadID;
extern pthread_t ttyUSBRxThread;
extern pthread_t ttyUSBRxThreadID;
extern pthread_t USBHIDRxThread;
extern pthread_t USBHIDRxThreadID;
void *TTYS0RxThreadProcess(void *arg);
void *TTYS0TxThreadProcess(void *msg);
void TTYtransferDat(void *msg);
void *TTYS1RxThreadProcess(void *msg);
void *TTYUSBRxThreadProcess(void *msg);
void USBHIDtransferDat(void *msg);
void *USBHIDTxThreadProcess(void *msg);
void *USBHIDRxThreadProcess(void *msg);
void SigAlarmProcess(int sig);
#endif

